<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head th:replace="dashboard/header :: header"></head>
<body>
	<div layout:fragment="content">
		
		<div class="container-fluid">
            <div class="row">
               
                <div class="col-lg-8" >
                  <div class="col-sm-12 search-collapse">
						<form id="operlog-form">
							<div class="select-list">
								<ul>
									<li>
										<label>系统模块： </label><input type="text" name="condition[codeName|like]"/>
									</li>
									<li>
										<label>操作人员： </label><input type="text" name="condition[codeValue|like]"/>
									</li>
									<li>
										<label>代码状态： </label><input type="text" name="condition[hasStatus]"/>
									</li>
									<li>
										<a class="btn btn-primary btn-rounded btn-sm" onclick="searchPre()"><i class="fa fa-search"></i>&nbsp;搜索</a>
										<a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
									</li>
								</ul>
							</div>
						</form>
					</div>
					
					<div class="btn-group-sm" id="toolbar" role="group">
						<a class="btn btn-success" onclick="$.operate.add()">
							<i class="fa fa-plus"></i> 新增
						</a>
						<a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()">
				            <i class="fa fa-remove"></i> 删除
				        </a>
				        <a class="btn btn-danger" onclick="$.operate.clean()">
			                <i class="fa fa-trash"></i> 清空
			            </a>
			            <a class="btn btn-warning" onclick="$.table.exportExcel()">
				            <i class="fa fa-download"></i> 导出
				        </a>
			        </div>
			        
					<div class="col-sm-12 select-table table-striped">
						<table id="bootstrap-table" data-mobile-responsive="true"></table>
					</div>
                </div>
                
                 <div class="col-lg-4">
                
                	<div class="col-sm-12 search-collapse">
						<form id="operlog-form">
							<div class="select-list">
								<ul>
									<li>
										<label>类型名称 ： </label><input type="text" name="title"/>
									</li>
									<li>
										<a class="btn btn-primary btn-rounded btn-sm" onclick="searchPre()"><i class="fa fa-search"></i>&nbsp;搜索</a>
									</li>
								</ul>
							</div>
						</form>
					</div>
              		 <div class="btn-group-sm" id="toolbar-type" role="group">
							<a class="btn btn-success" onclick="$.operate.add()">
								<i class="fa fa-plus"></i> 新增
							</a>
							<a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()">
								<i class="fa fa-remove"></i> 删除
							</a>
							<a class="btn btn-warning" onclick="test()">
								<i class="fa fa-download"></i> 导出
							</a>
					</div>
					<div class="col-sm-12 select-table table-striped">
						
						<table id="bootstrap-table-type" data-mobile-responsive="true"></table>
					</div>
					
                </div>
                
              <!-- /.col-->
            </div>
            <!-- /.row-->
        </div>

		
	</div>

	<footer th:replace="dashboard/footer :: footer"></footer>
	
	 <script>
		var detailFlag = "";
		var prefix = ctx + "monitor/operlog";
		var tableType ; 

		$(function() {
		    var typeOptions = {
		    	id: "bootstrap-table-type",
		    	url: ctx+"boot/platform/dictionaryType/datatables" ,
			    createUrl: ctx + 'boot/platform/dictionaryType/addType' ,
			    updateUrl: ctx+"boot/platform/dictionaryType/modifyType?id={id}" ,
			    detailUrl: ctx+"boot/platform/dictionaryType/detail?id={id}",
			    removeUrl: ctx+"boot/platform/dictionaryType/deleteType" ,
			    changeStatusUrl: ctx+"boot/platform/dictionaryType/changeStatus?id={id}" , 
			    exportUrl: prefix + "/export",
		        sortName: "operTime",
		        toolbar: "toolbar-type" ,
		        uniqueId:"id" ,
		        sortOrder: "desc",
		        modalName: "操作日志",
		        escape: true,
		        showPageGo: true,
		        rememberSelected: true,
		        columns: [{field: 'state',checkbox: true },
		        	 
			        {field: 'applicationIdLabel', title: '所属应用'},
			        {field: 'codeTypeName', title: '代码类型'},
			        {field: 'codeTypeValue', title: '代码值'} ,
			        {field: 'id' , title: '操作',  align: 'center',  formatter: function(value, row, index) {
			                var actions = [];
						
			            	//  actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-search"></i>代码</a> ');
			                actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
			                
			                return actions.join('');
			          }
			     }]
		    };
		    $.table.init(typeOptions);
		    
		    var options = {
			        url: ctx+"boot/platform/dictionary/datatables" ,
			        createUrl: ctx + 'boot/platform/dictionary/add' ,
			        updateUrl: ctx+"boot/platform/dictionary/modify?id={id}" ,
			        detailUrl: ctx+"boot/platform/dictionary/detail?id={id}",
			        removeUrl: ctx+"boot/platform/dictionary/delete" ,
			        changeStatusUrl: ctx+"boot/platform/dictionary/changeStatus?id={id}" , 
			        exportUrl: prefix + "/export",
			        sortName: "operTime",
			        uniqueId:"id" ,
			        sortOrder: "desc",
			        modalName: "操作日志",
			        escape: true,
			        showPageGo: true,
			        rememberSelected: true,
			        columns: [{field: 'state',checkbox: true },
			        	
				        {field: 'applicationIdLabel', title: '所属应用'},
				        {field: 'codeTypeValueLabel', title: '代码类型'},
				        {field: 'codeName', title: '代码名称'} ,
				        {field: 'codeValue', title: '代码值'} ,
				        {field: 'hasStatusLabel', title: '状态', align: 'center',  formatter:function(value,row,index){ return $.table.status(value , row);}},
				        {field: 'id' , title: '操作',  align: 'center',  formatter: function(value, row, index) {
				                var actions = [];
				                
				                actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
				                actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
				                
				                return actions.join('');
				          }
				     }]
			    };
			    $.table.init(options);
		});
		
		function test(){
			var t = tableType ; ////$("#bootstrap-table-type").bootstrapTable('bootstrap-table-type');
			alert("添加" + t._option.createUrl);
		}
		
	</script>

</body>
</html>
